package com.iafme.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.systemframework.annotation.DataMask;
import com.systemframework.enums.DataMaskEnum;
import com.systemframework.jackson.DataMaskingSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author summer
 * @version 1.0
 * @date 2025/3/28 11:47
 */
@Data
@SearchBean(tables = "iafme_certificate_info i " +
        "LEFT JOIN iafme_member m ON i.memberId=m.id " +
        "LEFT JOIN iafme_project p ON i.projectId=p.id " +
        "LEFT JOIN iafme.iafme_level il on i.levelId=il.id " +
        "left join iafme_certificate c ON c.id=i.certificateId")
public class SearchCertificateResDTO implements Serializable {

    @DbField("i.id")
    private Integer id;

    @DbField("i.sendingTime")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date sendingTime;

    @DbField("m.name")
    private String name;

    @DbField("i.certificateNo")
    private String certificateNo;

    @DbField("CONCAT(m.surname,' ',m.egName)")
    private String egName;

    @DbField("il.name")
    private String levelName;


    @DataMask(function = DataMaskEnum.IDCARDNUM)
    @DbField("m.idCard")
    private String idCard;

    @DbField("CONCAT(p.name,'(',c.name,')') ")
    private String projectName;
}
